package com.ruoyi.ruoyixingyue.modules.api.controller;


import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.page.PageData;
import com.ruoyi.ruoyixingyue.modules.api.po.TeacherListPo;
import com.ruoyi.ruoyixingyue.modules.api.service.ITeacherService;
import com.ruoyi.ruoyixingyue.modules.api.vo.*;
import com.ruoyi.ruoyixingyue.modules.utils.Condition;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 星月教师表
 前端控制器
 * </p>
 *
 * @author lzz
 * @since 2024-02-18
 */
@Api("教师数据维护")
@RestController
@RequestMapping("/teacher")
public class TeacherController {

    @Autowired
    private ITeacherService iTeacherService;

    @ApiOperation("教师分页接口")
    @PostMapping("/teacher/list/API_001")
    public R<PageData<TeacherListPo>> teacherListAPI_001(@RequestBody Condition<TeacherListVo> condition) {
        return iTeacherService.teacherListAPI_001(condition);
    }

    @ApiOperation("修改教师状态")
    @PostMapping("/teacher/updateStatus/API_002")
    public R<String> teacherUpdateStatusAPI_002(@RequestBody TeacherStatusVo teacherStatusVo) {
        return iTeacherService.teacherUpdateStatusAPI_002(teacherStatusVo);
    }

    @ApiOperation("新增教师")
    @PostMapping("/teacher/insert/API_003")
    public R<String> teacherInsertAPI_003(@RequestBody TeacherInsertVo teacherInsertVo) {
        return iTeacherService.teacherInsertAPI_003(teacherInsertVo);
    }

    @ApiOperation("修改教师回显信息接口")
    @PostMapping("/teacher/updatea/API_004/{id}")
    public R<TeacherListPo> teacherUpdateAPI_004(@PathVariable("id") Long id) {
        return iTeacherService.teacherUpdateAPI_004(id);
    }

    @ApiOperation("修改教师信息")
    @PostMapping("/teacher/update/API_005")
    public R teacherUpdateAPI_005(@RequestBody TeacherUpdateVo teacherUpdateVo) {
        return iTeacherService.teacherUpdateAPI_005(teacherUpdateVo);
    }

    @ApiOperation("删除教师信息")
    @PostMapping("/teacher/delete/API_006/{id}")
    public R teacherDeleteAPI_006(@PathVariable("id") Long id) {
        return iTeacherService.teacherDeleteAPI_006(id);
    }

    @ApiOperation("教师字典接口")
    @PostMapping("/teacher/dict/API_007")
    public R teacherDictAPI_007() {
        return iTeacherService.teacherDictAPI_007();
    }

}
